//
//  LingViewController.m
//  家范
//
//  Created by 吴军虎吴军虎 on 16/4/13.
//  Copyright © 2016年 lanjue. All rights reserved.
//

#import "LingViewController.h"


@interface LingViewController ()

@property (nonatomic,retain) UIView *myheaderView;

@end

@implementation LingViewController

-(void) viewWillAppear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden=YES;
}

-(void) viewWillDisappear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden=NO;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor=LV;
    
    self.title=@"零钱明细";
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back"] style:UIBarButtonItemStylePlain target:self action:@selector(Back:)];
    self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor];
    
    [self createFoot];
}


#pragma mark 内容
-(void) createFoot
{
    
    //充值
    UILabel *chonglabel=[[UILabel alloc]init];
    [self setUpChildViewControll:chonglabel backgroundColor:nil alpha:0.8 text:@"充值" textColor:[UIColor blackColor] font:[UIFont systemFontOfSize:16]];
    [chonglabel mas_makeConstraints:^(MASConstraintMaker *make){
    
        make.top.equalTo(self.view).offset(36/2 *AUTO_WIDTH);
        make.left.equalTo(self.view).offset(57/2 *AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(80 *AUTO_WIDTH, 25 *AUTO_WIDTH));
    }];
    
    
    //日期
    UILabel *rilabel=[[UILabel alloc]init];
    [self setUpChildViewControll:rilabel backgroundColor:LV alpha:1.0 text:@"2016-03-28 14:19:15" textColor:ZI font:[UIFont systemFontOfSize:14]];
    [rilabel mas_makeConstraints:^(MASConstraintMaker *make){
    
        make.top.equalTo(chonglabel.mas_bottom).offset(12/2 *AUTO_WIDTH);
        make.left.equalTo(self.view).offset(57/2 *AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(140 *AUTO_WIDTH, 18 *AUTO_WIDTH));
    }];
    
    //横线
    UILabel *henglabel=[[UILabel alloc]init];
    [self setUpChildViewControll:henglabel backgroundColor:[UIColor grayColor] alpha:0.4 text:nil textColor:nil font:nil];
    [henglabel mas_makeConstraints:^(MASConstraintMaker *make){
    
        make.top.equalTo(rilabel.mas_bottom).offset(12/2 *AUTO_WIDTH);
        make.left.equalTo(self.view).offset(57/2 *AUTO_WIDTH);
        make.right.equalTo(self.view).offset(-57/2 *AUTO_WIDTH);
        make.height.mas_equalTo(1 *AUTO_WIDTH);
    }];
    
    //0.10
    UILabel *label=[[UILabel alloc]init];
    [self setUpChildViewControll:label backgroundColor:LV alpha:0.5 text:@"0.10" textColor:nil font:[UIFont fontWithName:SHUZI size:26]];
    
    [label mas_makeConstraints:^(MASConstraintMaker *make){
    
        make.top.mas_equalTo(self.view).offset(53/2 *AUTO_WIDTH);
        make.right.mas_equalTo(self.view).offset(-63/2 *AUTO_WIDTH);
        make.bottom.mas_equalTo(henglabel.mas_top).offset(-36/2 *AUTO_WIDTH);
    }];
    
    
    //加号
    UILabel *jialabel=[[UILabel alloc]init];
    [self setUpChildViewControll:jialabel backgroundColor:LV alpha:0.5 text:@"+" textColor:nil font:[UIFont fontWithName:SHUZI size:26]];
    [jialabel mas_makeConstraints:^(MASConstraintMaker *make){
    
        make.top.equalTo(self.view).offset(58/2 *AUTO_WIDTH);
        make.right.equalTo(label.mas_left).offset(0);
        make.size.mas_equalTo(CGSizeMake(14 *AUTO_WIDTH, 20 *AUTO_WIDTH));
    }];
}

#pragma mark UILabel
-(void) setUpChildViewControll:(UILabel *) label backgroundColor:(UIColor *) backgroundColor alpha:(CGFloat) alpha  text:(NSString *) text textColor:(UIColor *) textColor font:(UIFont *) font
{
    label.backgroundColor=backgroundColor;
    label.alpha=alpha;
    label.text=text;
    label.textColor=textColor;
    label.font=font;
    [self.view addSubview:label];
}

//返回按钮
-(void) Back:(UIButton *) btn
{
    NSArray *array=self.navigationController.viewControllers;
    [self.navigationController popToViewController:[array objectAtIndex:1] animated:YES];
}


@end
